package com.swpu.zdl.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.swpu.zdl.pojo.XuanKe;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface XuanKeMapper extends BaseMapper<XuanKe> {

    public List<XuanKe> getXuankesByCid(Integer cid);
    @Insert("insert into xuanke(nian_du,xue_qi,ke_xu_hao)" +
            "values (#{nianDu},#{xueQi},#{keXuHao})")
    Boolean addXuanKe(XuanKe xuanKe);
    @Delete("delete  from xuanke where ke_xu_hao = #{keXuHao}")
    Boolean deleteXuanKe(String keXuHao);

    Boolean updateXuanKe(@Param("kexuhao") String keXuHao,
                         @Param("xuanke") XuanKe xuanKe);
    @Select("select * from xuanke")
    List<XuanKe> getAll();

    List<XuanKe> getAllMsg();

    XuanKe getMsgWithStudent(String keXuHao);
}
